// 销售数据
function xzzc_bottom_e () {
    var chartDom = document.querySelector(".xzzc_bottom_e");
    var myChart = echarts.init(chartDom);

    var fontColor = "#ffffff";
    option = {
        // backgroundColor: "#11183c",
        grid: {
            left: "0%",
            right: "3%",
            top: "20%",
            bottom: "3%",
            containLabel: true,//是否显示x轴坐标
        },
        // 鼠标选入弹出信息
        tooltip: {
            show: true,
            trigger: "item",
        },
        legend: {
            show: true,
            x: "center",
            y: "0",//顶部标题距离顶部的距离
            icon: "circle",//顶部标题旁图标是圆形
            itemWidth: 10,
            itemHeight: 10,
            textStyle: {
                color: "#1bb4f6",
            },
            data: ["桃子", "梨子", "苹果", "草莓"],
        },
        xAxis: [
            {
                type: "category",
                boundaryGap: false,
                axisLabel: {
                    color: fontColor,
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: "#35476D",
                    },
                },
                axisTick: {
                    show: false,
                },
                splitLine: {
                    show: false,
                    lineStyle: {
                        color: "#195384",
                    },
                },
                data: [
                    "01月",
                    "02月",
                    "03月",
                    "04月",
                    "05月",
                    "06月",
                    "07月",
                    "08月",
                    "09月",
                    "10月",
                    "11月",
                    "12月",
                ],
            },
        ],
        yAxis: [
            {
                type: "value",
                name: "",
                min: 0,
                max: 1000,
                axisLabel: {
                    formatter: "{value}",
                    textStyle: {
                        color: "#A5B6D3",
                    },
                },
                // 去除y轴刻度线
                axisLine: {
                    show: false
                    // lineStyle: {
                    //     color: "#27b4c2",
                    // },
                },
                axisTick: {
                    show: false,
                },
                splitLine: {
                    show: true,
                    lineStyle: {
                        type: "dashed",
                        color: "#35466E",
                        width: 1
                    },
                },
            },
        ],
        series: [
            {
                name: "桃子",
                type: "line",
                stack: "桃子",
                symbol: "circle",
                symbolSize: 8,
                itemStyle: {
                    normal: {
                        color: "#00CEFF",
                        lineStyle: {
                            color: "#00CEFF",
                            width: 1,
                        },
                        // 阴影渐变
                        //           areaStyle: {
                        // 			//color: '#94C9EC'
                        // 			color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
                        // 				offset: 0,
                        // 				color: 'rgba(7,44,90,0.3)'
                        // 			}, {
                        // 				offset: 1,
                        // 				color: 'rgba(0,146,246,0.9)'
                        // 			}]),
                        //           }
                    },
                },
                markPoint: {
                    itemStyle: {
                        normal: {
                            color: "red",
                        },
                    },
                },
                data: [120, 132, 101, 134, 90, 230, 210, 182, 191, 234, 290, 330],
            },
            {
                name: "梨子",
                type: "line",
                stack: "梨子",
                symbol: "circle",
                symbolSize: 8,

                itemStyle: {
                    normal: {
                        color: "#34CE72",
                        lineStyle: {
                            color: "#34CE72",
                            width: 1,
                        },
                    },
                },
                data: [120, 182, 191, 234, 390, 230, 110, 201, 254, 390, 130, 210],
            },
            {
                name: "苹果",
                type: "line",
                stack: "苹果",
                symbol: "circle",
                symbolSize: 8,

                itemStyle: {
                    normal: {
                        color: "#F9D354",
                        lineStyle: {
                            color: "#F9D354",
                            width: 1,
                        },
                    },
                },
                data: [120, 282, 591, 134, 690, 830, 910, 401, 154, 290, 130, 210],
            },
            {
                name: "草莓",
                type: "line",
                stack: "草莓",
                symbol: "circle",
                symbolSize: 8,

                itemStyle: {
                    normal: {
                        color: "#FFA13F",
                        lineStyle: {
                            color: "#FFA13F",
                            width: 1,
                        },
                    },
                },
                data: [120, 282, 191, 134, 590, 630, 210, 801, 254, 190, 230, 210],
            },
        ],
    };
    // 3. 把配置项给实例对象
    myChart.setOption(option);
    // 4. 让图表跟随屏幕自动的去适应
    window.addEventListener("resize", function () {
        myChart.resize();
    });
} 

 
// 库存
 function leidatu () {
    var chartDom = document.querySelector(".leidatu");
    var myChart = echarts.init(chartDom);

    var option = {
        // backgroundColor: "#000",
        tooltip: {
            show: true,
            trigger: "item",
        },

        radar: {
            // shape: 'circle',
            name: {
                textStyle: {
                    color: "#fff",
                    //backgroundColor: '#999',
                    borderRadius: 3,
                    padding: [-10, -10],
                },
            },
            // y轴分割线
            axisLine: {
                lineStyle: {
                    color: "#06336F",
                    width: 1,
                    type: "solid",
                },
            },
            grid: {
                left: "0%",
                top: "0%",
                right: "0%",
                bottom: "4%",
                containLabel: true
            },

            splitArea: {
                areaStyle: {
                    color: ["#042254", "#0f2a5e"],
                },
            },
            // 零边形边框
            splitLine: {
                lineStyle: {
                    color: ['red', "#19669d", "#19669d", "#19669d"],
                    width: 0,
                },
            },
            indicator: [
                {
                    text: "苹果",
                    max: 2500,
                },
                {
                    text: "桃子",
                    max: 2500,
                },
                {
                    text: "杏",
                    max: 3500,
                },
                {
                    text: "火龙果",
                    max: 5500,
                },
                {
                    text: "大枣",
                    max: 7500,
                },
                {
                    text: "葡萄",
                    max: 1500,
                },
                {
                    text: "草莓",
                    max: 1500,
                },
                {
                    text: "梨",
                    max: 1500,
                },
            ],
        },
        series: [
            {
                name: "产量",
                type: "radar",
                symbol: "circle",
                symbolSize: 13,
                areaStyle: {
                    normal: {
                        color: "rgba(40,203,228,0.3)",

                    },
                },
                itemStyle: {
                    color: "rgba(40,202,206,1)",
                    borderColor: "rgba(26, 255, 228, 0.8)",

                },

                data: [
                    {
                        value: ["1200", "1000", "800", "1270", "1365", "1350", "1365", "1350"],
                        name: "就餐场合",
                    },
                ],
            },
        ],
    };
    // 3. 把配置项给实例对象
    myChart.setOption(option);
    // 4. 让图表跟随屏幕自动的去适应
    window.addEventListener("resize", function () {
        myChart.resize();
    });
} 
// 支出收入
 function zhichusr () {
    var myChart = echarts.init(document.querySelector(".zhichusr"));
    console.log(myChart, 'myChart')
    const CubeLeft = echarts.graphic.extendShape({
        shape: {
            x: 0,
            y: 0
        },
        buildPath: function (ctx, shape) {
            const xAxisPoint = shape.xAxisPoint;
            const c0 = [shape.x, shape.y];
            const c1 = [shape.x - 6, shape.y - 6];
            const c2 = [xAxisPoint[0] - 6, xAxisPoint[1] -6];
            const c3 = [xAxisPoint[0], xAxisPoint[1]];
            ctx
                .moveTo(c0[0], c0[1])
                .lineTo(c1[0], c1[1])
                .lineTo(c2[0], c2[1])
                .lineTo(c3[0], c3[1])
                .closePath();
        }
    });
    const CubeRight = echarts.graphic.extendShape({
        shape: {
            x: 0,
            y: 0
        },
        buildPath: function (ctx, shape) {
            const xAxisPoint = shape.xAxisPoint;
            const c1 = [shape.x, shape.y];
            const c2 = [xAxisPoint[0], xAxisPoint[1]];
            const c3 = [xAxisPoint[0] + 10, xAxisPoint[1] - 6];
            const c4 = [shape.x + 10, shape.y - 6];
            ctx
                .moveTo(c1[0], c1[1])
                .lineTo(c2[0], c2[1])
                .lineTo(c3[0], c3[1])
                .lineTo(c4[0], c4[1])
                .closePath();
        }
    });
    const CubeTop = echarts.graphic.extendShape({
        shape: {
            x: 0,
            y: 0
        },
        buildPath: function (ctx, shape) {
            const c1 = [shape.x, shape.y];
            const c2 = [shape.x + 10, shape.y - 6];//x上  y右侧
            const c3 = [shape.x + 6, shape.y - 10];
            const c4 = [shape.x - 6, shape.y - 6];
            ctx
                .moveTo(c1[0], c1[1])
                .lineTo(c2[0], c2[1])
                .lineTo(c3[0], c3[1])
                .lineTo(c4[0], c4[1])
                .closePath();
        }
    });
    echarts.graphic.registerShape("CubeLeft", CubeLeft);
    echarts.graphic.registerShape("CubeRight", CubeRight);
    echarts.graphic.registerShape("CubeTop", CubeTop);
    const MAX = [6000, 6000, 6000, 6000, 6000, 5000];
    const VALUE = [3012, 1230, 3790, 2349, 1654, 1230];
    var option = {
        tooltip: {
            // trigger: "axis",
            // axisPointer: {
            //   type: "shadow"
            // }
            trigger: "axis",
            axisPointer: {
                type: "shadow"
            },
            // formatter: function (params, ticket, callback) {
            //     const item = params[1];
            //     return item.name + " : " + item.value;
            // }
        },

        // backgroundColor: "#010d3a",
        title: {
            text: "",
            top: 0,
            bottom: 30,
            left: 18,
            textStyle: {
                color: "#fff",
                fontSize: 24
            }
        },
        // legend: {
        //     show: true,
        //     icon: "diamond",
        //     itemHeight: 11,
        //     textStyle: {
        //         color: "#fff",
        //         fontSize: "1.4rem",
        //     }
        // },
        
        legend: {
            // data: ["去年", "今年"],
            data: [{
                name: '收入',
                show: true,
                x: "center",
                y: "0",//顶部标题距离顶部的距离
                // icon: "circle",//顶部标题旁图标是圆形
                icon: 'image:///image/num_xc/qingse_lx.png',

                itemWidth: 18,
                itemHeight: 19,
                textStyle: {
                    // color: "#1bb4f6",
                color: '#A5B6D3'

                },
            },
            {
                name: '支出',
                show: true,
                x: "center",
                y: "0",//顶部标题距离顶部的距离
                // icon: "circle",//顶部标题旁图标是圆形
                icon: 'image:///image/num_xc/blue_lx.png',

                itemWidth: 18,
                itemHeight: 19,
                textStyle: {
                    // color: "#1bb4f6",
                    
                color: '#A5B6D3'
                    
                },
            }],

            show: true,
            x: "center",
            y: "0",//顶部标题距离顶部的距离
            icon: "circle",//顶部标题旁图标是圆形
            itemWidth: 18,
            itemHeight: 19,
            textStyle: {
                color: "#1bb4f6",
            },
        },
        grid: {
            left: "0%",
            top: "20%",
            right: "2%",
            bottom: "5%",
            containLabel: true
        },
        xAxis: {
            type: "category",
            data: [
                "桃子",
                "梨子",
                "苹果",
                "草莓",
                "火龙果",
                "葡萄"
            ],
            axisLine: {
                show: true,
                lineStyle: {
                    color: "#35456A"
                }
            },

            offset: 10,
            axisTick: {
                show: false
            },
            axisLabel: {
                interval: 0, //代表显示所有x轴标签显示 
                show: true,
                textStyle: {
                    color: "#fff",
                    fontSize: 11,
                    fontFamily: " Source Han Sans SC"
                }
            }
        },
        yAxis: {
            type: "value",
            axisLine: {
                show: false
            },
            splitLine: {
                lineStyle: {
                    type: "dashed",
                    color: "#35466E",
                    width: 1
                }
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                fontSize: 12,
                color: "#A5B6D3" // 文本颜色

            },
            boundaryGap: ["10%", "20%"]
        },
        series: [
            {
                name: "收入",
                type: "custom",
                stack: "Ad1",
                renderItem: function (params, api) {
                    const location = api.coord([api.value(0), api.value(1)]);
                    return {
                        type: "group",
                        children: [
                            {
                                type: "CubeLeft",
                                name: "b",
                                shape: {
                                    api,
                                    xValue: api.value(0),
                                    yValue: api.value(1),
                                    x: location[0],
                                    y: location[1],
                                    xAxisPoint: api.coord([api.value(0), 0])
                                },
                                style: {
                                    fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                        {
                                            offset: 0,
                                            color: " rgba(26, 255, 228, 1)"
                                        },
                                        {
                                            offset: 1,
                                            color: "rgba(26, 255, 228, 0.1)"
                                        }
                                    ])
                                }
                            },
                            {
                                type: "CubeRight",
                                shape: {
                                    api,
                                    xValue: api.value(0),
                                    yValue: api.value(1),
                                    x: location[0],
                                    y: location[1],
                                    xAxisPoint: api.coord([api.value(0), 0])
                                },
                                style: {
                                    fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                        {
                                            offset: 0,
                                            color: " rgba(26, 255, 228, 1)"
                                        },
                                        {
                                            offset: 1,
                                            color: "rgba(26, 255, 228, 0.1)"
                                        }
                                    ])
                                }
                            },
                            {
                                type: "CubeTop",
                                shape: {
                                    api,
                                    xValue: api.value(0),
                                    yValue: api.value(1),
                                    x: location[0],
                                    y: location[1],
                                    xAxisPoint: api.coord([api.value(0), 0])
                                },
                                style: {
                                    fill: "#5ADFFF"
                                }
                            }
                        ]
                    };
                },
                data: MAX
            },

            {
                stack: "Ad1",

                type: "custom",
                name: "支出",
                renderItem: (params, api) => {
                    const location = api.coord([api.value(0), api.value(1)]);
                    return {
                        type: "group",
                        children: [
                            {
                                type: "CubeLeft",
                                shape: {
                                    api,
                                    xValue: api.value(0),
                                    yValue: api.value(1),
                                    x: location[0],
                                    y: location[1],
                                    xAxisPoint: api.coord([api.value(0), 0])
                                },
                                style: {
                                    fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                        {
                                            offset: 0,
                                            color: "#0067C7"
                                        },
                                        {
                                            offset: 1,
                                            color: "#0085FF"
                                        }
                                    ])
                                }
                            },
                            {
                                type: "CubeRight",
                                shape: {
                                    api,
                                    xValue: api.value(0),
                                    yValue: api.value(1),
                                    x: location[0],
                                    y: location[1],
                                    xAxisPoint: api.coord([api.value(0), 0])
                                },
                                style: {
                                    fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                        {
                                            offset: 0,
                                            color: "#0067C7"
                                        },
                                        {
                                            offset: 1,
                                            color: "#0085FF"
                                        }
                                    ])
                                }
                            },
                            {
                                type: "CubeTop",

                                shape: {
                                    api,
                                    xValue: api.value(0),
                                    yValue: api.value(1),
                                    x: location[0],
                                    y: location[1],
                                    xAxisPoint: api.coord([api.value(0), 0])
                                },
                                style: {
                                    fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                        {
                                            offset: 0,
                                            color: "#5ADFFF"
                                        },
                                        {
                                            offset: 1,
                                            color: "#5ADFFF"
                                        }
                                    ])
                                }
                            }
                        ]
                    };
                },
                data: VALUE
            }
        ]
    };
    // 3. 把配置项给实例对象
    myChart.setOption(option);
    // 4. 让图表跟随屏幕自动的去适应
    window.addEventListener("resize", function () {
        myChart.resize();
    });
} 

// 产量
 function chanl() {
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.querySelector(".chanl"));
    //echarts折线图

    let dataList = [
        {
            name: "桃子",
            value: "112",
        },
        {
            name: "梨子",
            value: "313",
        },
        {
            name: "苹果",
            value: "263",
        },
        {
            name: "草莓",
            value: "212",
        },
        {
            name: "火龙果",
            value: "610",
        },
        {
            name: "葡萄",
            value: "228",
        },
    ];
    let dataList2 = [
        {
            name: "桃子",
            value: "712",
        },
        {
            name: "梨子",
            value: "213",
        },
        {
            name: "苹果",
            value: "63",
        },
        {
            name: "草莓",
            value: "212",
        },
        {
            name: "火龙果",
            value: "10",
        },
        {
            name: "葡萄",
            value: "108",
        },

    ];

    option = {
        backgroundColor: "#031942",
        tooltip: {
            trigger: "axis",
        },

        legend: {
            // data: ["去年", "今年"],
            data: [{
                name: '去年',
                show: true,
                x: "center",
                y: "0",//顶部标题距离顶部的距离
                // icon: "circle",//顶部标题旁图标是圆形
                icon: 'image:///image/num_xc/blue_lx.png',
                itemWidth: 18,
                itemHeight: 19,
                textStyle: {
                    color: "#1bb4f6",
                },
            },
            {
                name: '今年',
                show: true,
                x: "center",
                y: "0",//顶部标题距离顶部的距离
                // icon: "circle",//顶部标题旁图标是圆形
                icon: 'image:///image/num_xc/qingse_lx.png',
                itemWidth: 18,
                itemHeight: 19,
                textStyle: {
                    color: "#1bb4f6",
                },
            }],

            show: true,
            x: "center",
            y: "0",//顶部标题距离顶部的距离
            icon: "circle",//顶部标题旁图标是圆形
            itemWidth: 18,
            itemHeight: 19,
            textStyle: {
                color: "#1bb4f6",
            },
        },
        title: {
            left: 26,
            top: 26,
            textStyle: {
                color: "#FFFFFF",
                fontSize: 15,
                fontWeight: 50000,
                fontFamily: "PingFang SC",
            },
        },

        grid: {
            left: "2%",
            right: "2%",
            bottom: "0%",
            top: "25%",
            containLabel: true,
        },
        dataZoom: [
            {
                type: "inside",
                start: 0,
                end: dataList.length > 15 ? 35 : 100,
            },
        ],
        xAxis: {
            axisLine: {
                lineStyle: {
                    color: "#354770",
                },
            },
            splitLine: {
                show: false,
            },
            axisTick: {
                show: false,
            },
            //轴线上的字
            axisLabel: {
                show: true,
                textStyle: {
                    color: "#ffffff",
                    fontSize: "14",
                },
            },
            data: [
                "桃子",
                " 梨子",
                " 苹果",
                " 草莓",
                " 火龙果",
                "葡萄 ",

            ],
        },
        yAxis: [
            {
                type: "value",
                splitNumber: 4,
                axisTick: {
                    show: false,
                },
                //轴线上的字
                axisLabel: {
                    textStyle: {
                        fontSize: "12",
                        color: "#cecece",
                    },
                },

                axisLine: {
                    show: false,
                    // lineStyle: {
                    //     color: "#397cbc",
                    // },
                },
                //网格线
                splitLine: {
                    lineStyle: {
                        type: "dashed",
                        color: "#35466E",
                        width: 1

                    },
                },
            },
        ],
        series: [
            {
                name: "去年",
                type: "line",
                smooth: true, //是否平滑曲线显示
                showSymbol: false,
                // 水滴效果
                // markPoint: {
                //     data: [
                //         {
                //             name: "周最高",
                //             value: 320,
                //             xAxis: 4,
                //             yAxis: 320,
                //         },
                //     ],
                // },
                itemStyle: {
                    color: "#3eb5dd",
                    borderColor: "#f1f1f1",
                    borderWidth: 1,
                },
                lineStyle: {
                    normal: {
                        width: 2,
                        color: {
                            type: "linear",

                            colorStops: [
                                {
                                    offset: 0,
                                    color: "#57b3e5", // 0% 处的颜色
                                },
                                {
                                    offset: 1,
                                    color: "#31a9ea", // 100% 处的颜色
                                },
                            ],
                            globalCoord: false, // 缺省为 false
                        },
                        shadowColor: "rgba(249,165,137, 0.5)",
                        shadowBlur: 30,
                        shadowOffsetY: 5,
                    },
                },
                areaStyle: {
                    //区域填充样式
                    normal: {
                        color: new echarts.graphic.LinearGradient(
                            0,
                            0,
                            0,
                            1,
                            [
                                {
                                    offset: 0,
                                    color: "rgba(58,182,224, 0.6)",
                                },
                                {
                                    offset: 0.6,
                                    color: "rgba(58,182,224, 0.2)",
                                },
                                {
                                    offset: 0.8,
                                    color: "rgba(58,182,224, 0.01)",
                                },
                            ],
                            false
                        ),
                        shadowColor: "rgba(58,182,224, 0.1)",
                        shadowBlur: 6,
                    },
                },
                data: dataList,
            },
            {
                name: "今年",
                type: "line",
                smooth: true, //是否平滑曲线显示
                showSymbol: false,
                itemStyle: {
                    color: "#ff6b71",
                    borderColor: "#f1f1f1",
                    borderWidth: 1,
                },
                // 水滴效果
                // markPoint: {
                //     data: [
                //         {
                //             name: "周最高",
                //             value: 310,
                //             xAxis: 5,
                //             yAxis: 310,
                //         },
                //     ],
                // },
                lineStyle: {
                    normal: {
                        width: 2,
                        color: {
                            type: "linear",

                            colorStops: [
                                {
                                    offset: 0,
                                    color: "#1AFFE4", // 0% 处的颜色
                                },
                                {
                                    offset: 1,
                                    color: "#1AFFE4", // 100% 处的颜色
                                },
                            ],
                            globalCoord: false, // 缺省为 false
                        },
                        shadowColor: "rgba(255,107,113, 0.5)",
                        shadowBlur: 12,
                        shadowOffsetY: 5,
                    },
                },
                areaStyle: {
                    //区域填充样式
                    normal: {
                        color: new echarts.graphic.LinearGradient(
                            0,
                            0,
                            0,
                            1,
                            [
                                {
                                    offset: 0,
                                    color: "rgba(26, 255, 228, 0.3)",
                                },
                               
                                {
                                    offset: 1,
                                    color: "rgba(26, 255, 228, 0)",
                                },
                            ],
                            false
                        ),
                        shadowColor: "rgba(255,107,113, 0.4)",
                        shadowBlur: 6,
                    },
                },
                data: dataList2,
            },
        ],
    };



    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
    window.addEventListener("resize", function () {
        myChart.resize();
    });

} 

// 地图
  function maps() {
    var cityCodeArr = ["4100", '4107']; // 河南 新乡

    const allAreaData = []; // 所有区县的统计数据
    // const cityCodeArr = ["5100", "5101"]; // ["5100", "5101"] [省、市]
    console.log('cityCodeArr111', cityCodeArr)
    if (myChart) {
        myChart.dispose(); // 销毁实例，实例销毁后无法再被使用。
    }
    // 初始化图表
    var myChart = echarts.init(document.querySelector(".maps"));
    // JSON文件(地图数据)路径
    var loadedDataURL = '';
    let cityCode = '';
    cityCode = (cityCodeArr[1]).toString().slice(0, 4) + '00'; // 市级城市json码 4位 后面+00
    loadedDataURL = `./js/geometryCouties/${cityCode}.json`;
    // if (cityCodeArr.length == 2) { // 选择了 省市两级 只展示市
    //     cityCode = (cityCodeArr[1]).toString().slice(0, 4) + '00'; // 市级城市json码 4位 后面+00
    //     loadedDataURL = `./map/geometryCouties/${cityCode}.json`;
    // } else if (cityCodeArr.length == 1) {// 只选择省
    //     cityCode = (cityCodeArr[0]).toString().slice(0, 2); // 省json只有前两位数字
    //     loadedDataURL = `./map/geometryProvince/${cityCode}.json`;
    // } else {
    //     loadedDataURL = `./map/china.json`;
    //     cityCode = 'china';
    // }
    // 显示加载动画效果,可以在加载数据前手动调用该接口显示加载动画，在数据加载完成后调用 hideLoading 隐藏加载动画。
    // myChart.showLoading();
    let mapName = cityCode;
    // 引入JSON文件
    $.get(loadedDataURL, function (geoJson) {

        const data = geoJson.features.map((item, index) => {
            const geoAreaName = item.properties.name; // geo文件中的地理名称
            const currentArea = allAreaData.find(item => {
                return item.name == geoAreaName
            })
            let taskNumber = index, volunteerNumber = index;
            if (currentArea) {
                taskNumber = currentArea.taskNumber;
                volunteerNumber = currentArea.volunteerNumber;
            }
            return {
                name: geoAreaName,
                value: volunteerNumber,
                taskNumber: taskNumber, // 活动总数
                volunteerNumber: volunteerNumber * 10, // 志愿者总数
                // coord: item.properties.center,
                coord: item.properties.centroid,
                selected: true
                // x: 150,
                // y: 150
            }
        })
        console.log('geoJson:', geoJson)
        // 注册地图名字(tongren)和数据(geoJson)

        echarts.registerMap(mapName, geoJson);

        // 隐藏动画加载效果。
        // myChart.hideLoading();

        // 图表配置项
        var option = {

            // title: { // 标题
            //   top: '2%',
            //   text: '3D地图',
            //   subtext: '',
            //   x: 'center',
            //   textStyle: {
            //     color: '#ccc'
            //   }
            // },
            selectedMode: 'multiple', // 选中效果固话
            tooltip: { // 提示框
                show: true,
                trigger: 'item',
                formatter: function (params) {
                    return params.name;
                }
            },
            grid: {
                left: "0%",
                top: "0%",
                right: "3%",
                bottom: "0%",
                containLabel: true
            },
            series: [

                {
                    name: 'map3D',
                    type: "map3D", // map3D / map
                    zoom: 1.6,  
                    map: mapName,

                    label: { // 标签的相关设置
                        show: true, // (地图上的城市名称)是否显示标签 [ default: false ]
                        // distance: 5, // 标签距离图形的距离，在三维的散点图中这个距离是屏幕空间的像素值，其它图中这个距离是相对的三维距离
                        //formatter:, // 标签内容格式器
                        textStyle: { // 标签的字体样式
                            color: '#ffffff', // 地图初始化区域字体颜色
                            fontSize: 14, // 字体大小
                            opacity: 1, // 字体透明度
                            backgroundColor: 'rgba(0,23,11,0.5)' // 字体背景色
                        },
                        // normal:{
                        //   show:true,
                        //   formatter:function(params){ //标签内容
                        //     // console.log(params)
                        //     return  params.name;
                        //   },
                        //   // lineHeight: 20,
                        //   backgroundColor:'rgba(255,255,255,.9)',
                        //   borderColor:'#80cffd',
                        //   borderWidth:'1',
                        //   padding:[5,15,4],
                        //   color:'#000000',
                        //   fontSize: 12,
                        //   fontWeight:'normal',
                        // },
                        emphasis: {
                            show: true,//鼠标悬入不显示地名
                            // itemStyle: {
                            //   show: "true",
                            //   borderWidth: 4,
                            //   borderColor: "#b2163c", //边框颜色
                            //   areaColor: "#531f67" //鼠标移上去的颜色
                            // },
                            // label: {
                            //   color: "#fff",
                            //   fontWeight: "bold",
                            //   show: true
                            // }
                        }
                    },
                    tooltip: { //提示框组件。
                        alwaysShowContent: true,
                        hoverAnimation: true,
                        trigger: 'item', //触发类型 散点图
                        enterable: true, //鼠标是否可进入提示框
                        transitionDuration: 1, //提示框移动动画过渡时间
                        triggerOn: 'click',
                        formatter: function (params) {
                            // console.log(params.name, 'params.name')
                            if (params.name) {
                                var str = `
                    <div class="map-tooltip">
                      <div class="city-name">${params.name}</div>
                      <div class="city-info">志愿者人数：<span class="city-num">${params.data.volunteerNumber}</span></div>
                      <div class="city-info">活动总数：<span class="city-num">${params.data.taskNumber}</span></div>
                    </div>
                    `
                                return str;
                            }
                        },
                        // backgroundColor: 'rgba(30, 54, 124,1)',
                        // backgroundColor: '#01FEDD',
                        borderWidth: '1px',
                        borderRadius: '4',
                        borderColor: '#00B2AC',
                        textStyle: {
                            color: 'rgba(255,255,255,1)'
                        },
                        padding: [5, 10]
                    },
                    itemStyle: { // 三维地理坐标系组件 中三维图形的视觉属性，包括颜色，透明度，描边等。
                        // areaColor: 'rgba(95,158,160,0.5)', // 地图板块的颜色
                        areaColor: '#4286EC', // 地图板块的颜色
                        opacity: 1, // 图形的不透明度 [ default: 1 ]
                        borderWidth: 1, // (地图板块间的分隔线)图形描边的宽度。加上描边后可以更清晰的区分每个区域 [ default: 0 ]
                        borderColor: '#63D4F8' // 图形描边的颜色。[ default: #333 ]
                    },

                    data: data,
                    // 3d地图添加 markPoint 位置不对
                    /*markPoint:{
                      symbolSize: 45,
                      symbol: 'path://m 0,0 h 48 v 20 h -30 l -6,10 l -6,-10 h -6 z',
                      itemStyle: {
                        normal: {
                          borderColor: '#33CBFF',
                          color:'#33CBFF',
                          borderWidth: 1,            // 标注边线线宽，单位px，默认为1
                          label: {
                            show: true
                          }
                        }
                      },
                      data: data
                    }*/
                }],
        };

        // 设置图表实例的配置项以及数据，万能接口，所有参数和数据的修改都可以通过setOption完成，ECharts 会合并新的参数和数据，然后刷新图表。
        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
        // 动态显示tootip /*map3D中 不生效*/
        // setTimeout(() => {
        //   console.log('dispatchAction');
        //   myChart.dispatchAction({
        //     type: 'showTip',
        //     seriesIndex: 0,
        //     dataIndex: 1
        //   });
        // }, 3000);
    });
} 
